<template>
	<view class="content">
		<u-navbar
			:title="title"
			:autoBack="true"
			:placeholder="true"
		>
		</u-navbar>
		<view class="pact-td">
			<rich-text :nodes="agreementext"></rich-text>
		</view>
	</view>
</template>

<script>
	import {agreement} from '@/api/protocol.js'
	export default{
		data(){
			return{
				title:'',
				agreementext:''
			}
		},
		methods:{
			async agreementapi(state){
				const res = await agreement(state)
				this.title = res.data.title
				this.agreementext = res.data.content
			}
		},
		onLoad(el) {
			this.agreementapi(el.type)
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #fafafa;
	}
	.content {
		padding: 0 40rpx;
	}
	.pact-td {
		margin-top: 40rpx;
		margin-bottom: 18rpx;
	}
</style>